import request from '@/utils/request'
import { makeFormData } from '@/utils/util'

export const api = {
  list: 'api/checker/list',
  add: 'api/checker/add',
  delete: 'api/checker',
  push: '/api/checker/device/notify_full_sync'
}

export function addSubmit (data = {}) {
  return request({
    url: api.add,
    method: 'post',
    data: makeFormData(data)
  })
}

export function delAttendance (data = {}) {
  return request({
    url: api.delete,
    method: 'delete',
    data: makeFormData(data)
  })
}

export function pushNotification (data = {}) {
  return request({
    url: api.push,
    method: 'post',
    data: makeFormData(data)
  })
}
